<?php

namespace App\Containers\AppSection\Questionnaire\Traits;

use App\Containers\AppSection\Questionnaire\Tasks\FindResponseByIdTask;

trait IsOwnerProfileTrait
{
    public function isOwnerProfile(): bool
    {
        $response = app(FindResponseByIdTask::class)->run($this->id);

        return $this->profile()->id === $response->questionnaire->legal_form->profile->id;
    }
}
